package water.utils;


import water.modle.cmdModle.WaterCmdModle;

/**
  *@description: 水表命令生成器
  *@create:2019-12-06
 **/

public class WaterCmdGenerator {
    private static byte READ_HIS_DATA=0x05;

    public static void initCmd(){

    }
    public static WaterCmdModle readHisData(String addr, byte[] time){
        WaterCmdModle waterCmdModle=new WaterCmdModle();
        waterCmdModle.setMeterAddr(addr);
        byte[] data=new byte[8];
        for(int i=0;i<data.length;i++){
            if(i<4){
                data[i]=0x00;
            }
            data[i]=time[i+4];
        }
        waterCmdModle.setCmdData(new String(data));

        waterCmdModle.setCrc(9);
        return null;
    }
}
